package com.visionet.school.app.web.entity.enums;

/**
 * Created by hxpeng on 2017/3/31.
 */
public enum EntrustEnums {
    AUDIO("audio","音频"),
    TEXT("text","文本"),
    EXECUTE("execute","已执行"),
    UNEXECUTED("unexecuted","未执行");

    private String key;
    private String value;

    EntrustEnums(String key, String value){
        this.key = key;
        this.value = value;
    }

    public static EntrustEnums fromCode(String key){
        for (EntrustEnums type : values()){
            if(type.key.equalsIgnoreCase(key)){
                return type;
            }
        }
        return null;
    }

    public String toKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
